﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Leo.Common.RabbitMQ
{
    /// <summary>
    /// 队列绑定
    /// </summary>
    public class RabbitQueueBinder
    {
        public RabbitQueueBinder(RabbitExchangeInfo exchange, RabbitQueueInfo queue, string routingKey)
        {
            if (string.IsNullOrEmpty(routingKey))
            {
                throw new ArgumentNullException("routingKey", "rotingKey不能为空！");
            }

            if (exchange is null)
            {
                throw new ArgumentNullException("exchange");
            }

            if (queue is null)
            {
                throw new ArgumentNullException("queue");
            }
        }


        /// <summary>
        /// 交换机
        /// </summary>
        public RabbitExchangeInfo Exchange { get; set; }
        /// <summary>
        /// 队列
        /// </summary>
        public RabbitQueueInfo Queue { get; set; }
        /// <summary>
        /// routingKey
        /// </summary>
        public string RoutingKey { get; set; }


        //public string GetPseudoUrl()
        //{
        //    return string.Concat(new string[]
        //    {
        //        this.Exchange.ExchangeType.GetStringValue(),
        //        "://",
        //        this.Exchange.Name,
        //        "/",
        //        this.RoutingKey
        //    });
        //}





    }
}
